home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / 3DTOSHI2.ZIP / mpgfx / source / lgfxvgag.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-25  |  1.4 KB  |  86 lines

  1.  
  2. // lgfxvgag.cpp
  3. //
  4. // Copyright (c) 1995 by Toshiaki Tsuji, all rights reserved.
  5.  
  6. #include "stdgfx.h"
  7. #include "lgfxvga.h"
  8.  
  9. LONG  SrcWd;
  10. LONG  SrcHt;
  11.  
  12. // VOID SetVGASelector ( SHORT Selector )
  13. // EAX = Selector
  14.  
  15. VOID SetVGASelector ( SHORT Selector )
  16. {
  17.   if (Selector)
  18.     {}
  19. } // End of SetVGASelector
  20.  
  21.  
  22. // VOID VGACopy256To256 ( BYTE *Src, LONG AddSrc, LONG SrcWd, LONg SrcHt,
  23. //                        LONG DestCx, LONG DestCy )
  24. //
  25. // EAX = Src, EDX = AddSrc, EBX = SrcWd, ECX = SrcHt
  26.  
  27. VOID VGACopy256To256 ( BYTE *Src, LONG AddSrc, LONG SrcWidth, LONG SrcHeight,
  28.                        LONG DestCx, LONG DestCy )
  29. {
  30. if (Src)
  31.   {}
  32. if (AddSrc)
  33.   {}
  34. if (SrcWidth)
  35.   {}
  36. if (SrcHeight)
  37.   {}
  38. if (DestCx)
  39.   {}
  40. if (DestCy)
  41.   {}
  42. #ifdef __FORx86__
  43. __asm {
  44.   pushad
  45.   mov  EAX, Src
  46.   mov  EDX, AddSrc
  47.   mov  EBX, SrcWidth
  48.   mov  ECX, SrcHeight 
  49.  
  50.   mov  ESI, EAX   // ESI = Src
  51.   mov  SrcWd, EBX
  52.   mov  SrcHt, ECX
  53.   
  54.   sub  EDX, EBX
  55.   mov  EBX, EDX   // EBX = AddSrc - SrcWd
  56.  
  57.   mov  EDI, 0A0000h
  58.   mov  EAX, DestCy
  59.   mov  EDX, 320
  60.   mul  EDX  
  61.   add  EAX, DestCx
  62.   add  EDI, EAX
  63.   
  64.   mov  EDX, 320
  65.   sub  EDX, SrcWd
  66.   cld
  67.  
  68.   Copy256OutLoop :
  69.     mov ECX, SrcWd
  70.     mov EAX, ECX
  71.     and EAX, 03h
  72.     shr ECX, 2
  73.     rep movsd
  74.     mov ECX, EAX
  75.     rep movsb
  76.     add ESI, EBX
  77.     add EDI, EDX
  78.     dec SrcHt
  79.     jnz Copy256OutLoop
  80.  
  81.   popad
  82. } // End asm
  83. #endif
  84. } // End of VGACopy256To256
  85.  
  86.